<extend name="Base/member"/>

<block name="breadcrumb">
  <ul class="breadcrumb">
    <li><a href="{:U('/')}">首页</a></li>
    <li class="active">我的积分</li>
  </ul>
</block>

<block name="body">
  <div class="user-box">
    <h3>
      我的积分
      <small>
        <ul class="box-nav clearfix">
          <li class="<eq name="type" value="">active</eq>">
            <a href="{:U('Member/score')}">积分明细</a>
          </li>
          <li class="<eq name="type" value="in">active</eq>">
            <a href="{:U('Member/score?type=in')}">积分奖励</a>
          </li>
          <li class="<eq name="type" value="out">active</eq>">
            <a href="{:U('Member/score?type=out')}">积分消费</a>
          </li>
          <!-- <li class="<eq name="type" value="消费">active</eq>">
            <a href="{:U('Member/score')}">积分规则</a>
          </li> -->
        </ul>
      </small>
    </h3>
    <p class="text-space">当前可用积分：<em class="text-danger">{$member.score}</em></p>

    <!-- 积分明细 -->
    <switch name="type">
      <case value=""><h3>积分明细</h3></case>
      <case value="in"><h3>积分奖励</h3></case>
      <case value="out"><h3>积分消费</h3></case>
    </switch>
    <div class="row list-info">
      <div class="col-xs-12">
        <div class="hd clearfix">
          <span class="col-xs-3">积分时间</span>
          <span class="col-xs-3">奖励/消费</span>
          <span class="col-xs-6">积分备注</span>
        </div>
      </div>
      <notempty name="lists">
        <volist name="lists" id="vo">
          <div class="col-xs-12">
            <div class="bd clearfix">
              <div class="col-xs-3">{$vo.create_time|time_format}</div>
              <div class="col-xs-3">
                <eq name="vo.type" value="in"><span class="text-success">+{$vo.amount}</span></eq>
                <eq name="vo.type" value="out"><span class="text-danger">-{$vo.amount}</span></eq>
              </div>
              <div class="col-xs-6">
                {$vo.memo}
                <notempty name="vo.order_sn">（订单号：<a href="{:U('Order/detail?order_sn='.$vo['order_sn'])}">{$vo.order_sn}</a>）</notempty>
              </div>
            </div>
          </div>
        </volist>
        <div class="page">{$_page}</div>
      <else/>
        <div class="col-xs-12">
          <p class="list-empty">您暂时没有积分<switch name="type"><case value="">明细</case><case value="in">奖励</case><case value="out">消费</case></switch>数据。</p>
        </div>
      </notempty>
    </div>
  </div>
</block>